package operand

import "fmt"

// Str is the wrapped string value.
type Str string

func (s Str) String() string {
	return string(s)
}

func (s Str) Add(other any) (any, error) {
	return fmt.Sprintf("%s%s", s, other), nil
}

func (s Str) Sub(other any) (any, error) {
	return nil, fmt.Errorf("minus is not supported on string")
}

func (s Str) Mul(other any) (any, error) {
	return nil, fmt.Errorf("multiply is not supported on string")
}

func (s Str) Div(other any) (any, error) {
	return nil, fmt.Errorf("division is not supported on string")
}

func (s Str) Mod(other any) (any, error) {
	return nil, fmt.Errorf("remainder is not supported on string")
}

func (s Str) Neg() (any, error) {
	return nil, fmt.Errorf("negative is not supported on string")
}

func (s Str) Bool() bool {
	return s != ""
}

func (s Str) Eq(other any) bool {
	return s == other
}
